/**
 * Copyright (C) 2013 Guangzhou Tronlong Electronic Technology Co., Ltd. - www.tronlong.com
 *
 * @file mainwindow.cpp
 *
 * @brief Example application main file.
 * LVGL led control.
 *
 * @author Tronlong <support@tronlong.com>
 *
 * @version V1.0
 *
 * @date 2024-8-10
 **/

#include <lvgl/lvgl.h>
#include <lvgl/lv_conf.h>
#include "main.h"
#include "home_ui.h"

static int quit = 0;

int main(int argc, char **argv)
{	
    signal(SIGINT, sigterm_handler);

    struct sched_param param; int max_priority;

    max_priority = sched_get_priority_max(SCHED_FIFO); param.sched_priority = max_priority;

    if (sched_setscheduler(0, SCHED_FIFO, &param) == -1) {perror("sched_setscheduler failed");}

    lv_port_init();

    rk_desk_init();
    
    while (!quit)
    {
        lv_task_handler();
        usleep(100);
    }

    return 0;
}

static void sigterm_handler(int sig)
{
    fprintf(stderr, "signal %d\n", sig);
    quit = 1;
}